package com.fulihui.weixinclient.model.message;

import java.util.Date;

import javax.xml.bind.annotation.XmlElement;

import org.near.toolkit.model.ToString;

/**
 * 微信消息模型基础抽象类
 * @author Willard.Hu on 2016/8/18.
 */
public abstract class AbstractWeixinMessage extends ToString {
    private static final long serialVersionUID = 3212453631379665072L;
    /**
     * 开发者微信号
     */
    @XmlElement(name = "ToUserName")
    private String            toUserName;
    /**
     * 发送方帐号（一个OpenID）
     */
    @XmlElement(name = "FromUserName")
    private String            fromUserName;
    /**
     * 消息创建时间 （整型）
     */
    @XmlElement(name = "CreateTime")
    private long              createTime;
    /**
     * 消息类型
     * @see MsgTypeContents
     */
    @XmlElement(name = "MsgType")
    private String            msgType;

    public Date createTime() {
        return new Date(this.createTime * 1000);
    }

    public String getToUserName() {
        return toUserName;
    }

    public void setToUserName(String toUserName) {
        this.toUserName = toUserName;
    }

    public String getFromUserName() {
        return fromUserName;
    }

    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }
}
